<?php

//require_once ('application/controllers/applicationController.php');

class authController extends applicationController {
	
	/**
	 * 
	 */
	function __construct() {
		parent::__construct ();
		//TODO - Insert your code here
	}
	
	/**
	 * 
	 */
	function __destruct() {
		
	//TODO - Insert your code here
	}
	
	public function signIn(){
		$fc = FrontController::getInstance();
		$params = $fc->getParams();
		$username = $params['username'];
		$password = $params['password'];
		if ($username == "huy"&& $password=="1234"){
			$_SESSION['username'] = 'huy';
			$result = $this->smarty->fetch('index.tpl');//$view->render ( '../views/login.php' );
			$fc->setBody ( $result );
		}else{
			$result = $this->smarty->fetch('login.tpl');//$view->render ( '../views/login.php' );
			$fc->setBody ( $result );			
		}
	}
	
	public function  signOut(){
		
	}
	
	public function index(){
		
	}
	
	function login(){
		$fc = FrontController::getInstance ();
		//$params = $fc->getParams ();
		//$view = new View ( );
		//$view->name = $params ['name'];
		$result = $this->smarty->fetch('login.tpl');//$view->render ( '../views/login.php' );
		$fc->setBody ( $result );
	}
	
	function  logout(){
		
	}
}
?>